/*
 * $Id: UiFileDetails.java,v 1.3 2010/05/17 19:55:54 navdeep_mahajan Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

package com.ge.healthcare.autosc.ui.pojo;

import java.io.File;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.database.pojo.ActFileTransferDetails;
import com.ge.healthcare.autosc.common.util.ApplicationInfo;
import com.ge.healthcare.autosc.ui.commons.ASDPropertyConstants;

public class UiFileDetails extends AscUiObject {
	private Long ft_id;
	private Long requestId;
	private String direction;
	private String fileName;
	private String fileDir;
	private String status;
	private String checkSum;
	private Long contentSize;
	private Character isInternal;
	private Boolean existsInBO = false;
	private String fileWebServerURL = null;

	public UiFileDetails() {

	}

	public UiFileDetails(ActFileTransferDetails fileDetails) {
		this.setStartTime(fileDetails.getStartTime());
		this.setEndTime(fileDetails.getEndTime());
		this.ft_id = fileDetails.getFtId();
		this.requestId = fileDetails.getRequestId();
		this.direction = fileDetails.getDirection();
		this.fileName = fileDetails.getFileName();
		this.fileDir = fileDetails.getFileDir();
		this.status = fileDetails.getStatus();
		this.checkSum = fileDetails.getCheckSum();
		this.contentSize = fileDetails.getContentSize();
		this.isInternal = fileDetails.getIsInternal();
		if (!ASCUtil.isNullOrEmpty(fileDir) && !ASCUtil.isNullOrEmpty(fileName)
				&& new File(this.fileDir, this.fileName).exists()) {
			this.existsInBO = true;
		}
		this.fileWebServerURL = ApplicationInfo.getInstance().getProperty(
				ASDPropertyConstants.ASD_FILE_DELIVERY_WEB_SERVER_URL);
	}

	/**
	 * @return the ft_id
	 */
	public Long getFt_id() {
		return ft_id;
	}

	/**
	 * @param ft_id
	 *            the ft_id to set
	 */
	public void setFt_id(Long ft_id) {
		this.ft_id = ft_id;
	}

	/**
	 * @return the requestId
	 */
	public Long getRequestId() {
		return requestId;
	}

	/**
	 * @param requestId
	 *            the requestId to set
	 */
	public void setRequestId(Long requestId) {
		this.requestId = requestId;
	}

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status
	 *            the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the checkSum
	 */
	public String getCheckSum() {
		return checkSum;
	}

	/**
	 * @param checkSum
	 *            the checkSum to set
	 */
	public void setCheckSum(String checkSum) {
		this.checkSum = checkSum;
	}

	/**
	 * @return the contentSize
	 */
	public Long getContentSize() {
		return contentSize;
	}

	/**
	 * @param contentSize
	 *            the contentSize to set
	 */
	public void setContentSize(Long contentSize) {
		this.contentSize = contentSize;
	}

	/**
	 * @return the isInternal
	 */
	public Character getIsInternal() {
		return isInternal;
	}

	/**
	 * @param isInternal
	 *            the isInternal to set
	 */
	public void setIsInternal(Character isInternal) {
		this.isInternal = isInternal;
	}

	/**
	 * @return the direction
	 */
	public String getDirection() {
		return direction;
	}

	/**
	 * @param direction
	 *            the direction to set
	 */
	public void setDirection(String direction) {
		this.direction = direction;
	}

	/**
	 * @return the fileName
	 */
	public String getFileName() {
		return fileName;
	}

	/**
	 * @param fileName
	 *            the fileName to set
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	/**
	 * @return the fileDir
	 */
	public String getFileDir() {
		return fileDir;
	}

	/**
	 * @param fileDir
	 *            the fileDir to set
	 */
	public void setFileDir(String fileDir) {
		this.fileDir = fileDir;
	}

	/**
	 * @return the existsInBO
	 */
	public Boolean getExistsInBO() {
		return existsInBO;
	}

	/**
	 * @param existsInBO
	 *            the existsInBO to set
	 */
	public void setExistsInBO(Boolean existsInBO) {
		this.existsInBO = existsInBO;
	}

	/**
	 * @return the fileWebServerURL
	 */
	public String getFileWebServerURL() {
		return fileWebServerURL;
	}

	/**
	 * @param fileWebServerURL
	 *            the fileWebServerURL to set
	 */
	public void setFileWebServerURL(String fileWebServerURL) {
		this.fileWebServerURL = fileWebServerURL;
	}
}
